home *** CD-ROM | disk | FTP | other *** search
/ JCSM Shareware Collection 1996 September / JCSM Shareware Collection (JCS Distribution) (September 1996).ISO / tutorial / trac.zip / FIGI-5.OBJ < prev    next >
Text File  |  1990-01-25  |  3KB  |  46 lines

  1. 0010     401000 Put X into 1000 (Sets 1001 - 1004 to zero)
  2. 0011     001000 Load accumulator with X
  3. 0012     250048 If X is zero jump to halt instruction
  4. 0013     240017 If X is negative, skip next 3 instructions     
  5. 0014     001501 Load +1                                        
  6. 0015     031502 Store at S (sign)                              
  7. 0016     260022 Branch unconditionally around next 5           
  8. 0017     001503 Load -1                                        
  9. 0018     031502 Store at S                                     
  10. 0019     001500 Load zero                                      
  11. 0020     021000 Subtract X (This makes a negative X positive)  
  12. 0021     031000 Store back at X                                
  13. 0022     001501 Load 1                                         
  14. 0023     030002 I=1 using index register 2                     
  15. 0024     001000 Load X                                         
  16. 0025     360008 Shift it right 8                               
  17. 0026     031001 Store at Y                                     
  18. 0027     001001 Load Y (Note this is the start of a loop)      
  19. 0028     151504 Multiply by 8                                  
  20. 0029     031001 Store at Y                                     
  21. 0030     001000 Load X                                         
  22. 0031    2370000 Shift left by I (Contents of register 2)       
  23. 0032     360008 Shift right 8 (This isolates an octal digit)   
  24. 0033     011001 Add previous Y                                 
  25. 0034     031001 Store back at Y                                
  26. 0035     000002 Load I                                         
  27. 0036     011501 Add 1                                          
  28. 0037     030002 Store at I                                     
  29. 0038     021505 Subtract 9 to see if done                      
  30. 0039     240027 If negative repeat loop                        
  31. 0040     001000 Load X                                         
  32. 0041     151502 Multiply by sign                               
  33. 0042     031000 Store at X                                     
  34. 0043     001001 Load Y                                         
  35. 0044     151502 Multiply by sign                               
  36. 0045     031001 Store at Y                                     
  37. 0046     411000 Print X, Y                                     
  38. 0047     260010 Branch back to start                           
  39. 0048     500000 Halt
  40. 1500          0 Zero
  41. 1501          1 One
  42. 1503         -1 Negative one
  43. 1504          8 Eight
  44. 1505          9 Nine
  45. 9999         10 End of code and starting location
  46.